/*eslint-disable */
import common from "@common/api/common";
import constants from "../constants";
import apiConstants from "@common/api/constants";
import { message } from '@common/assets/js/resetMessage';

export default {
    namespaced: true,
    state: {
        ...constants,
    },
    actions: {
        getSysClientBizOfficeList(store, client_sid) {
            return common.requestData(apiConstants.API_FindSysClientBizOffices, {
                client_sid,
            }).then(result => {
                if (result.code !== 0) {
                    return Promise.reject(result);
                }
                return result.data || [];
            }).catch(err => {
                message.error(err.message);
                return [];
            });
        },
        getSysContractPersonList(store, org_sid) {
            return common.requestData(apiConstants.API_FindSysContractPersons, {
                org_sid,
            }).then(result => {
                if (result.code !== 0) {
                    return Promise.reject(result);
                }
                return result.data || [];
            }).catch(err => {
                message.error(err.message);
                return [];
            });
        },
    },
}
